home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: What's your compiler's answer?
- Date: Fri, 09 Feb 96 02:04:57 GMT
- Organization: none
- Message-ID: <823831497snz@genesis.demon.co.uk>
- References: <1996Feb7.140945.28351@cs.rit.edu> <4fao4h$dn8@beach.and.nl>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4fao4h$dn8@beach.and.nl> jos@and.nl "Jos A. Horsmeier" writes:
-
- >| i = i-- - --i * ( i = -3 ) * i++ + ++i;
-
- ...
-
- >No seriously, you shouldn't present this example at all, because the
- >behavior of that expression is undefined. One single object 'i' is
- >altered more than once between two sequence points, so anything can
- >happen. And this 'anything' doesn't happen because of a lack of
- >complete determination of operator precedence ...
-
- Yes, it is important to stress that this expression doesn't even have to
- generate a result. However the examples collected by this request could
- be useful evidence to hammer it into people's head that they shouldn't
- write things like this.
-
- The expression does generate an impressive number of different results
- on different compilers! :-)
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-